import request from "../http/http"
const isLoggedIn = localStorage.getItem('token');

//新增维修记录
export const addWeixiu = (category) => {
    console.log(category,'调用了添加接口')
    return request.post('/admin/addrepair', category,{
        headers:{
            Token:isLoggedIn
        }
    });
};

//查询维修记录列表
export const getWeixiuList = (count) => {
    return request.get('/admin/getrepairs', {
        params:{
            page:count,
            size:20
        },
        headers:{
            Token:isLoggedIn
        }
    });
};

//删除维修记录
export const deleteWeixiu = (id) => {
    console.log('出车记录',id)
    return request.delete(`/admin/deleterepair/${id}`,{
        headers:{
            Token:isLoggedIn
        }
    });s
};

// 修改维修记录
export const putWeixiu = (data) => {
    console.log(data,'调用了修改接口')
    return request.put('/admin/updaterepair', data,{
        headers:{
            Token:isLoggedIn
        }
    });
};